3.227 \(\int \cot ^2(c+d x) (a+a \sec (c+d x))^n \, dx\)

Optimal. Leaf size=102 \[ -\frac {2^{n-1} \cot (c+d x) \left (\frac {1}{\sec (c+d x)+1}\right )^{n-1} (a \sec (c+d x)+a)^n F_1\left (-\frac {1}{2};n-2,1;\frac {1}{2};-\frac {a-a \sec (c+d x)}{\sec (c+d x) a+a},\frac {a-a \sec (c+d x)}{\sec (c+d x) a+a}\right )}{d} \]

[Out]

-2^(-1+n)*AppellF1(-1/2,-2+n,1,1/2,(-a+a*sec(d*x+c))/(a+a*sec(d*x+c)),(a-a*sec(d*x+c))/(a+a*sec(d*x+c)))*cot(d
*x+c)*(1/(1+sec(d*x+c)))^(-1+n)*(a+a*sec(d*x+c))^n/d

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {3889} \[ -\frac {2^{n-1} \cot (c+d x) \left (\frac {1}{\sec (c+d x)+1}\right )^{n-1} (a \sec (c+d x)+a)^n F_1\left (-\frac {1}{2};n-2,1;\frac {1}{2};-\frac {a-a \sec (c+d x)}{\sec (c+d x) a+a},\frac {a-a \sec (c+d x)}{\sec (c+d x) a+a}\right )}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + a*Sec[c + d*x])^n,x]

[Out]

-((2^(-1 + n)*AppellF1[-1/2, -2 + n, 1, 1/2, -((a - a*Sec[c + d*x])/(a + a*Sec[c + d*x])), (a - a*Sec[c + d*x]
)/(a + a*Sec[c + d*x])]*Cot[c + d*x]*((1 + Sec[c + d*x])^(-1))^(-1 + n)*(a + a*Sec[c + d*x])^n)/d)

Rule 3889

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> -Simp[(2^(m
 + n + 1)*(e*Cot[c + d*x])^(m + 1)*(a + b*Csc[c + d*x])^n*(a/(a + b*Csc[c + d*x]))^(m + n + 1)*AppellF1[(m + 1
)/2, m + n, 1, (m + 3)/2, -((a - b*Csc[c + d*x])/(a + b*Csc[c + d*x])), (a - b*Csc[c + d*x])/(a + b*Csc[c + d*
x])])/(d*e*(m + 1)), x] /; FreeQ[{a, b, c, d, e, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[n]

Rubi steps

\begin {align*} \int \cot ^2(c+d x) (a+a \sec (c+d x))^n \, dx &=-\frac {2^{-1+n} F_1\left (-\frac {1}{2};-2+n,1;\frac {1}{2};-\frac {a-a \sec (c+d x)}{a+a \sec (c+d x)},\frac {a-a \sec (c+d x)}{a+a \sec (c+d x)}\right ) \cot (c+d x) \left (\frac {1}{1+\sec (c+d x)}\right )^{-1+n} (a+a \sec (c+d x))^n}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 4.18, size = 893, normalized size = 8.75 \[ \frac {(a (\sec (c+d x)+1))^n \left (-2^n \cot \left (\frac {1}{2} (c+d x)\right ) \, _2F_1\left (-\frac {1}{2},n;\frac {1}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^n (\sec (c+d x)+1)^{-n}+2^n \, _2F_1\left (\frac {1}{2},n;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^n \tan \left (\frac {1}{2} (c+d x)\right ) (\sec (c+d x)+1)^{-n}-\frac {60 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \cos ^2\left (\frac {1}{2} (c+d x)\right ) \cos (c+d x) \sin (c+d x) \left (3 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-2 \left (F_1\left (\frac {3}{2};n,2;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-n F_1\left (\frac {3}{2};n+1,1;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{45 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ){}^2 (-2 \cos (c+d x) n+2 n+\cos (2 (c+d x))+1) \cos ^2\left (\frac {1}{2} (c+d x)\right )+40 \left (F_1\left (\frac {3}{2};n,2;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-n F_1\left (\frac {3}{2};n+1,1;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right ){}^2 \cos (c+d x) \sin ^2\left (\frac {1}{2} (c+d x)\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )+6 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sin ^2\left (\frac {1}{2} (c+d x)\right ) \left (-48 \left (2 F_1\left (\frac {5}{2};n,3;\frac {7}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-2 n F_1\left (\frac {5}{2};n+1,2;\frac {7}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )+n (n+1) F_1\left (\frac {5}{2};n+2,1;\frac {7}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right ) \cot (c+d x) \csc (c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )-5 F_1\left (\frac {3}{2};n,2;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) (2 n-2 (n+2) \cos (c+d x)+\cos (2 (c+d x))+1)+5 n F_1\left (\frac {3}{2};n+1,1;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) (2 n-2 (n+2) \cos (c+d x)+\cos (2 (c+d x))+1)\right )}\right )}{2 d} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Cot[c + d*x]^2*(a + a*Sec[c + d*x])^n,x]

[Out]

((a*(1 + Sec[c + d*x]))^n*(-((2^n*Cot[(c + d*x)/2]*Hypergeometric2F1[-1/2, n, 1/2, Tan[(c + d*x)/2]^2]*(Cos[c
+ d*x]*Sec[(c + d*x)/2]^2)^n*(Cos[(c + d*x)/2]^2*Sec[c + d*x])^n)/(1 + Sec[c + d*x])^n) + (2^n*Hypergeometric2
F1[1/2, n, 3/2, Tan[(c + d*x)/2]^2]*(Cos[c + d*x]*Sec[(c + d*x)/2]^2)^n*(Cos[(c + d*x)/2]^2*Sec[c + d*x])^n*Ta
n[(c + d*x)/2])/(1 + Sec[c + d*x])^n - (60*AppellF1[1/2, n, 1, 3/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*C
os[(c + d*x)/2]^2*Cos[c + d*x]*Sin[c + d*x]*(3*AppellF1[1/2, n, 1, 3/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^
2] - 2*(AppellF1[3/2, n, 2, 5/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2] - n*AppellF1[3/2, 1 + n, 1, 5/2, Tan
[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])*Tan[(c + d*x)/2]^2))/(45*AppellF1[1/2, n, 1, 3/2, Tan[(c + d*x)/2]^2, -
Tan[(c + d*x)/2]^2]^2*Cos[(c + d*x)/2]^2*(1 + 2*n - 2*n*Cos[c + d*x] + Cos[2*(c + d*x)]) + 6*AppellF1[1/2, n,
1, 3/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*Sin[(c + d*x)/2]^2*(-5*AppellF1[3/2, n, 2, 5/2, Tan[(c + d*x)
/2]^2, -Tan[(c + d*x)/2]^2]*(1 + 2*n - 2*(2 + n)*Cos[c + d*x] + Cos[2*(c + d*x)]) + 5*n*AppellF1[3/2, 1 + n, 1
, 5/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2]*(1 + 2*n - 2*(2 + n)*Cos[c + d*x] + Cos[2*(c + d*x)]) - 48*(2*
AppellF1[5/2, n, 3, 7/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2] - 2*n*AppellF1[5/2, 1 + n, 2, 7/2, Tan[(c +
d*x)/2]^2, -Tan[(c + d*x)/2]^2] + n*(1 + n)*AppellF1[5/2, 2 + n, 1, 7/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]
^2])*Cot[c + d*x]*Csc[c + d*x]*Sin[(c + d*x)/2]^4) + 40*(AppellF1[3/2, n, 2, 5/2, Tan[(c + d*x)/2]^2, -Tan[(c
+ d*x)/2]^2] - n*AppellF1[3/2, 1 + n, 1, 5/2, Tan[(c + d*x)/2]^2, -Tan[(c + d*x)/2]^2])^2*Cos[c + d*x]*Sin[(c
+ d*x)/2]^2*Tan[(c + d*x)/2]^2)))/(2*d)

________________________________________________________________________________________

fricas [F]  time = 0.63, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{2}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^n,x, algorithm="fricas")

[Out]

integral((a*sec(d*x + c) + a)^n*cot(d*x + c)^2, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{2}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((a*sec(d*x + c) + a)^n*cot(d*x + c)^2, x)

________________________________________________________________________________________

maple [F]  time = 1.03, size = 0, normalized size = 0.00 \[ \int \left (\cot ^{2}\left (d x +c \right )\right ) \left (a +a \sec \left (d x +c \right )\right )^{n}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+a*sec(d*x+c))^n,x)

[Out]

int(cot(d*x+c)^2*(a+a*sec(d*x+c))^n,x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{2}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((a*sec(d*x + c) + a)^n*cot(d*x + c)^2, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int {\mathrm {cot}\left (c+d\,x\right )}^2\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^2*(a + a/cos(c + d*x))^n,x)

[Out]

int(cot(c + d*x)^2*(a + a/cos(c + d*x))^n, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \left (\sec {\left (c + d x \right )} + 1\right )\right )^{n} \cot ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+a*sec(d*x+c))**n,x)

[Out]

Integral((a*(sec(c + d*x) + 1))**n*cot(c + d*x)**2, x)

________________________________________________________________________________________